package com.forekonw.demotest1024;


import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;

import java.util.Scanner;

/**
 * 输入一个0～100的分数，如果不是0～100之间，打印分数无效，根据分数等级打印A,B,C,D,E。
 */
public class exercise9 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入成绩：");
        double nub = input.nextDouble();
        int no = (int)nub /10;
            switch (no){
                case 10:
                    System.out.println("该成绩为A");
                    break;
                case 9:
                    System.out.println("该成绩为A");
                    break;
                case 8:
                    System.out.println("该成绩为B");
                    break;
                case 7:
                    System.out.println("该成绩为C");
                    break;
                case 6:
                    System.out.println("该成绩为D");
                    break;
                default:
                    if (no < 0){
                        System.out.println("分数无效");
        }else if (no>100){
                        System.out.println("分数无效");

                    }else {
                        System.out.println("该成绩为E");
                    }
        }
    }
}

